package com.szzg10.thinking.chapter18;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.List;

public class RecoverCADState {

	public static void main(String[] args) throws IOException, ClassNotFoundException {
		File file = new File(Worm.FILE_NAME_SERIALIZABLE);
		FileInputStream fileInputStream = new FileInputStream(file);
		ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
		
		objectInputStream.readObject();
		Line.deserializeStaticState(objectInputStream);
		List<Shape> shapes = (List<Shape>)objectInputStream.readObject();
		
		for(Shape element: shapes) {
			System.out.println(element);
		}
	}
}
